package com.gzedu.module.dao.role.impl;

import java.util.List;

import javax.annotation.Resource;

import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.stereotype.Repository;

import com.gzedu.common.sys.dao.impl.BaseDao;
import com.gzedu.module.dao.role.IRolePermissionDao;
import com.gzedu.module.modle.role.RolePermission;

@Repository
public class RolePermissionDaoImpl extends BaseDao<RolePermission> implements IRolePermissionDao{

	@Resource
    private SqlSessionFactory sqlSessionFactory;  
  
	public SqlSessionFactory getSqlSessionFactory() {
		return sqlSessionFactory;
	}

	public void setSqlSessionFactory(SqlSessionFactory sqlSessionFactory) {
		this.sqlSessionFactory = sqlSessionFactory;
	}
	
	public List<RolePermission> findListByRoleCode(RolePermission rolePermission) {
		// TODO Auto-generated method stub
		return sqlSessionFactory.openSession().selectList(super.getStatement()+".findListByRoleCode", rolePermission);
	}

	public int deleteByRoleCode(RolePermission rolePermission) {
		// TODO Auto-generated method stub
		return sqlSessionFactory.openSession().delete(super.getStatement()+".deleteByRoleCode", rolePermission);
	}
	
	

}
